package com.example.demo4.demos.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

//responseBody:返回数据
//
@Controller
@RequestMapping("/return")
public class userController {
    @RequestMapping("/r1")
    public String r1(){//返回静态页面
        return "/index.html";
    }
@ResponseBody
    @RequestMapping("/r2")
    public String r2(){
        return "<h1>我是返回的片段<h1>";
}
@ResponseBody
    @RequestMapping(value ="/r3",produces = "application/json")//设置content type
    public String r3(){
        return "1233";
}

}
